import request from '@/utils/request'


//优惠券列表
export function couponShow(pageNum, pageSize) {
  return request({
    url: '/coupon/coupon/couponShow?pageNum=' + pageNum + '&pageSize=' + pageSize,
    method: 'get'
  })
}

//新增优惠券
export function couponInsert(data) {
  return request({
    url: '/coupon/coupon/couponInsert',
    method: 'post',
    data: data
  })
}

//优惠券修改
export function couponUpdate(data) {
  return request({
    url: '/coupon/coupon/couponUpdate',
    method: 'post',
    data: data
  })
}

//优惠券删除
export function couponDelete(id) {
  return request({
    url: '/coupon/coupon/couponDelete?id='+id,
    method: 'get'
  })
}

// 查询优惠券详情
export function getCoupon(id) {
  return request({
    url: '/coupon/coupon/getCoupon?id=' + id,
    method: 'get'
  })
}

export function couponUpdPublish(id) {
  return request({
    url: '/coupon/coupon/couponUpdPublish?id=' + id,
    method: 'get'
  })
}

export function couponUpdStop(id) {
  return request({
    url: '/coupon/coupon/couponUpdStop?id=' + id,
    method: 'get'
  })
}

//用户查看优惠券列表
export function getSelectCoupon() {
  return request({
    url: '/coupon/coupon/getSelectCoupon',
    method: 'get'
  })
}

